<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>20210340937谢珍雯</title>
    <script src="./js/vue.global.js"></script>
</head>

<body>
    <div class="app">
        <h3>鼠标移入移出透明度改变：</h3>
        <img src="./img/img.png" width="200" @mouseout="remake" @mouseover="change" alt="">
        <hr>
        <h3>切换图片</h3>
        <img :src="imgSrc" @mouseout="changeSrc1" @mouseover="changeSrc2" alt="" width="200" height="200" srcset="">
        <br>
    </div>
    <script>
        const { createApp } = Vue
        const app = createApp({
            data() {
                return {
                    imgSrc:'./img/kes.webp'
                }
            },
            methods:{
                change(e){
                    e.target.style.opacity = 0.6;
                },
                remake(e){
                    e.target.style.opacity = 1;
                },
                changeSrc1(e){
                    this.imgSrc = './img/img.png'
                },
                changeSrc2(e){
                    this.imgSrc = './img/img2.png'
                }
            }
        })
        app.mount('.app')
    </script>
</body>

</html>